import sys


# 分别是步数和步长
START = 228
STEP = 32  # 先不动
NUM_STEPS = 1

f = open('./scripts/step2_run_generates.sh', 'w')
sys.stdout = f
for i in range(NUM_STEPS):
    START1 = START + STEP * i
    print("python ./scripts/generate_concurrent_run.py", START1, STEP)

f = open('./scripts/step3_chmod_all.sh', 'w')
sys.stdout = f
for i in range(NUM_STEPS):
    START2 = START + STEP * i
    print("chmod +x ./scripts/concurrent_run" + str(START2) + '_' + str(STEP) + ".sh")
print('chmod +x ./scripts/step4_run_all.sh')
print('chmod +x ./scripts/step0_analyse_workloads.sh')

f = open('./scripts/step4_run_all.sh', 'w')
sys.stdout = f
for i in range(NUM_STEPS):
    START3 = START + STEP * i
    print("sudo ./scripts/concurrent_run" + str(START3) + '_' + str(STEP) + ".sh")
# for i in range(5):
#     START11 = 10 * i
#     START22 = 10*i + 5
#     print('sudo ./scripts/concurrent_run' + str(START11) + '_5.sh')
#     print('wait')
#     print('sudo ./scripts/concurrent_run' + str(START22) + '_10.sh')
#     print('wait')
#     print('sudo rm -rf ../ssd/*')
#     print('')
